/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.farmcode.web.generation;

import com.farmcode.api.runtime.RuntimeServerAPI;
import com.farmcode.base.dao.DAOException;
import com.farmcode.console.api.business.custom.ExtProjectManager;
import com.farmcode.console.api.model.Project;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.ejb.EJB;

/**
 *
 * @author Oscar Ivan Prado
 */
public class GeneratorBase extends BaseCodeGenerator {
    
    private String projectName;
    
    @EJB
    private ExtProjectManager projectManager;
    @EJB
    private RuntimeServerAPI runtimeServerAPI;
    
    public String projectSelected(){
        try {
            Project project = projectManager.getProjectByName(getProjectName());
             goGenerateProject(project);
            
        } catch (DAOException ex) {
            Logger.getLogger(GeneratorBase.class.getName()).log(Level.SEVERE, null, ex);
        }
        
        return null;
    }

    /**
     * @return the projectName
     */
    public String getProjectName() {
        return projectName;
    }

    /**
     * @param projectName the projectName to set
     */
    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }
}
